package com.unlcn.ils.kas.service.util.enums;

public enum ErrorCodeEnum {
	PARAM_ISNULL("-2", "查询条件信息不能为空"), ARRIVETIME("-3", "运抵起始时间必须同时存在"), SHIPMENTTIME("-4", "发运起始时间必须同时存在"),
	CUSTOMERCODE_ISNULL("-5", "客户代码不能为空"), ARRIVETIME_INVALID("-6", "运抵开始时间必须小于运抵结束时间"),
	SHIPMENTTIME_INVALID("-7", "发运开始时间必须小于发运结束时间"), REFRESHTIME_INVALID("-9", "数据更新开始时间必须小于结束时间"),
	DAYS_INVALID("-8", "查询时间条件间隔不能大于7天");
	String code;

	String msg;

	ErrorCodeEnum(String code, String msg) {
		this.code = code;
		this.msg = msg;
	}

	public String getCode() {
		return this.code;
	}

	public String getMsg() {
		return this.msg;
	}

	public static ErrorCodeEnum getByValue(String code) {
		for (ErrorCodeEnum temp : ErrorCodeEnum.values()) {
			if (temp.getCode().equals(code)) {
				return temp;
			}
		}
		return null;
	}
}
